package com.hello;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;

public class Main2 {

    public static void main(String[] args) {
        ActorSystem system = ActorSystem.create("Hello");
        //actorOf--Create new actor as child of this context with the given name
        //actor 的名字是helloWorld
        /**
         * 当创建helloWorld的actor时，会通过preStart创建一个greeter的actor，
         * 然后greeter.tell(Greeter.Msg.GREET, getSelf());
         */
        ActorRef a = system.actorOf(Props.create(HelloWorld.class), "helloWorld");
        //actorOf--Create new actor as child of this context with the given name
        //actor 的名字是terminator
        system.actorOf(Props.create(Terminator.class, a), "terminator");
    }


}
